package rsj.api.account;

import com.rlyy.aibase.utils.base.Box;
import common.util.BoxUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import rsj.api.account.entity.AccountQueryParam;
import rsj.api.account.entity.Finance;
import rsj.service.account.IFinanceService;
import common.util.validator.ParameterConversionCheck;

import java.util.List;

/**
 * 财务
 *
 * @author yuanqinglong
 * @since 2021/7/15 10:37
 */
@RestController
public class FinanceController {

    @Autowired
    private IFinanceService financeServiceImp;


    /**
     * 财务列表
     *
     * @param param 参数
     * @return {@link Box}
     */
    @RequestMapping(value = "rsj_finance_list")
    public Box financeList(Box param){
        AccountQueryParam accountQueryParam = ParameterConversionCheck.parameterConversionCheckFastFail(param, AccountQueryParam.class);
        List<Finance> financeList = financeServiceImp.financeList(accountQueryParam);
        int total = financeServiceImp.financeCount(accountQueryParam);
        return BoxUtil.successBoxToTableData(param, financeList, total);
    }







}
